<?php

declare(strict_types=1);

namespace App\CustHub\Request;

use Mine\MineFormRequest;

class ChCaseRequest extends MineFormRequest
{
    /**
     * 公共规则.
     */
    public function commonRules(): array
    {
        return [];
    }

    /**
     * 新增数据验证规则
     * return array.
     */
    public function saveRules(): array
    {
        return [
            'image' => 'required',
            'brief' => 'required|max:50',
            'industry' => 'required',
            'detail' => 'required',
        ];
    }

    /**
     * 更新数据验证规则
     * return array.
     */
    public function updateRules(): array
    {
        return [
            'image' => 'required',
            'brief' => 'required|max:50',
            'industry' => 'required',
            'detail' => 'required',
        ];
    }

    /**
     * 修改状态数据验证规则
     * return array.
     */
    public function changeStatusRules(): array
    {
        return [
            'id' => 'required|integer',
            'industry' => 'required',
        ];
    }

    /**
     * 字段映射名称
     * return array.
     */
    public function attributes(): array
    {
        return [
            'id' => '案例ID',
            'image' => '图片',
            'brief' => '简介',
            'industry' => '类别',//1=教育培训,2=保险金融,3=家居家装,4=医疗美容,5=汽车,6=零售电商,7=制造,8=企业服务,9=房产物业,0=其他
            'detail' => '案例详情',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }
}